package com.jzd1997;

public class LineSearch {
    public static int lineSearch(int[] arr,int val){
        for(int i=0;i<arr.length;i++){
           if(val==arr[i]){
               return i;
           }
        }
        return -1;
    }

    public static void main(String[] args){
        int[] arr = new int[]{2,3,4,6,8};

        System.out.println(lineSearch(arr,8));
    }
}
